/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package controller;

import dataAccess.LabJpaController;
import entities.Lab;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

/**
 *
 * @author QUY-THI
 */
public class AddLab {

    public boolean addLab(Lab l) {
        try {
            EntityManagerFactory emf = Persistence.createEntityManagerFactory("E-AdministrationPU");
            LabJpaController cl = new LabJpaController(emf);
            cl.create(l);
            return true;
        } catch (Exception ex) {
            return false;
        }
    }
}
